This sample demonstrates the domain-related functionality provided by the UserInformation class of the Windows.System.UserProfile namespace. The UserInformation class enables an app to get and set information about the user, including the account picture, domain name, the principal name, and the Uniform Resource Identifier (URI) of the Session Initiation Protocol (SIP).
This sample covers the following scenarios:
- How to get the Domain Name System (DNS) domain name for the user.
- How to get the principal name for the user. This user's principle name is typically the user's email address, although this is not always true.
- How to get the SIP URI for the user.
This sample uses the following API elements from the UserInformation class:
- NameAccessAllowed property
- GetPrincipalNameAsync method
- GetDomainNameAsync method
- GetSessionInitiationProtocolUriAsync method
For a sample app that demonstrates how to get and set the image used for the user's tile, see the Account picture name sample. That sample also demonstrates the different ways of getting the name of the user that is currently logged in.
To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.
To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.
Note For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.
Related topics
Operating system requirements
| Client | |
|---|---|
| Server |
Build the sample
- Start Visual Studio 2013 and select File > Open > Project/Solution.
- Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file.
- Press F7 or use Build > Build Solution to build the sample.
Run the sample
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.